// Author: Bjorn Schobben

#ifndef LAND_H
#define LAND_H

#include <list>
#include "Province.h"


class Land
{
public:

	// Constructors
	Land(const std::string& name);
	Land(const Land& rhs);

	// Destructor
	virtual ~Land();

	// Clear all provinces from land
	void Clear();

	// Copy contents of another land
	void Copy(const Land& rhs);

	// Set land name
	void SetName(const std::string& name);
	// Get land name
	const std::string& GetName() const;

	// Test if land is filled in with unique colors as in the 4-color problem
	bool IsCompleted() const;

	// Set color of a province
	bool SetColor(const std::string& provinceName, Color color);

	// Get a unique list of colors used by provinces in the land
	void GetUniqueColors(std::list<Color>& colorTable) const;

	// Update the list of neighbours
	void UpdateNeighbours(const Land* neighbourLand);
	// Clear neighbours of all provinces
	void ClearNeighbours();

	// Operations on provinces list
	virtual Province* InsertNewProvince(const std::string& name);
	virtual Province* InsertNewProvince(const Province& province);
	std::list<Province*>& GetProvinces();
	Province* GetProvince(const std::string& provinceName);
	const Province* GetProvince(const std::string& provinceName) const;
protected:
	virtual Province* InsertProvince(Province* province);

	// Provinces list
	std::list<Province*> provinces;	
private:
	// Province name
	std::string name;
};

#endif //LAND_H